var t = getApp();

Page({
    data: {
        article_data: [],
        title: "",
        page_id: "",
        aid: ""
    },
    onLoad: function(t) {
        if (t.id) this.setData({
            page_id: t.id
        }); else {
            this.setData({
                page_id: ""
            });
            var a = this;
            wx.getStorage({
                key: "headline",
                success: function(t) {
                    a.setData({
                        article_data: t.data
                    });
                }
            }), wx.setNavigationBarTitle({
                title: "头条列表"
            });
        }
    },
    onReady: function() {},
    onShow: function() {
        this.tempInfo();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    onShareTimeline: function() {},
    toNoticeInfo: function(t) {
        var a = t.currentTarget.dataset.item;
        console.log(a), a.has_one_article_pay ? a.has_one_record ? wx.navigateTo({
            url: "/packageA/member/article/articleContent/articleContent?article_id=".concat(a.articleid ? a.articleid : a.id)
        }) : wx.navigateTo({
            url: "/packageD/article/articleList/articleList?article_id=".concat(a.articleid ? a.articleid : a.id)
        }) : wx.navigateTo({
            url: "/packageA/member/article/articleContent/articleContent?article_id=".concat(a.articleid ? a.articleid : a.id)
        });
    },
    tempInfo: function() {
        var a = this;
        if (this.data.page_id) {
            var e = t.getNetAddresss("home-page.wxapp");
            e += "&page_id=" + this.data.page_id, t._getNetWork({
                showToastIn: !1,
                url: e,
                success: function(t) {
                    var e = t.data;
                    1 == e.result && (e.data.item.data.forEach(function(t) {
                        "headline" == t.temp && t.id == a.data.aid && (console.log(t, a.data.aid), a.setData({
                            article_data: t.data,
                            title: t.params.toptitle
                        }));
                    }), a.data.title && wx.setNavigationBarTitle({
                        title: a.data.title
                    }));
                },
                fail: function(t) {}
            });
        }
    }
});